﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Admin.aspx.cs" Inherits="TicketsOnline.Admin" ValidateRequest="false"%>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<title>Administration Page</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:ScriptManager runat="server" ID="scriptManager"></asp:ScriptManager>
    <asp:UpdatePanel ID="PurchasesUpdatePanel" runat="server" UpdateMode="Always">
        
        <ContentTemplate>
           Status: <asp:DropDownList runat="server" ID="StatusFilterDropDown" ></asp:DropDownList>
            RefNo: <asp:TextBox runat="server" ID="RefNoFilterBox"></asp:TextBox>
            <asp:Button runat="server" ID="FilterButton" onclick="FilterButton_Click" Text="Filter results"/>
            <asp:ListView ID="PurchasesListView" runat="server">
                <ItemTemplate>
                    <div>
                    <h3>Order #<%# System.Web.HttpUtility.HtmlEncode(Eval("PurchaseID"))%></h3>
                    Event: <%# System.Web.HttpUtility.HtmlEncode(Eval("Event.Title")) %><br />
                    Customer: <%# System.Web.HttpUtility.HtmlEncode(Eval("CustomerName")) %><br />
                    Address: <%# System.Web.HttpUtility.HtmlEncode(Eval("ShippingAddress")) %><br />
                    Amount: <%# System.Web.HttpUtility.HtmlEncode(Eval("TicketCount")) %><br />
                    Status: <%# System.Web.HttpUtility.HtmlEncode(Eval("Status")) %> 
                    (<asp:LinkButton  OnClick="LinkButton_Clicked" CommandArgument=<%# Eval("PurchaseID") %> Text= <%# ((Eval("Status").ToString()=="Ordered")?"switch to Delivered":"switch to Ordered") %> runat="server"></asp:LinkButton>)
                    
                     <br /><br />
                 </div>
                </ItemTemplate>

            </asp:ListView>
            
            <asp:DataPager runat="server" ID="PurchasesDataPager" PagedControlID="PurchasesListView" PageSize="5" >
            
                  <Fields>
                    <asp:numericpagerfield ButtonCount="10" NextPageText="..." 
                        PreviousPageText="..." />
                    <asp:nextpreviouspagerfield FirstPageText="First" LastPageText="Last" 
                        NextPageText="Next" PreviousPageText="Previous" />
                        
                    </Fields>
                    
            </asp:DataPager>

        </ContentTemplate>
    
    </asp:UpdatePanel>

</asp:Content>
